Contents of this document

10 Steps to Multi-Language Delphi Projects	
1. Make a complete backup of your delphi project	
2. Create a new Translation Project by clicking the + in the db-navigator.	
3. Add a new language for your project.	
4. Scan the source code of your project (menu "scan | code")	
5. Translate the strings extracted from your source code	
6. Scan the forms of your project (menu "scan | forms")	
7. Translate the strings extracted from your forms	
8. Write changes both to the source code and to the forms (menu "Write	
changes | code" and "Write changes | forms")	
9. Recompile your project.	
10. Switching between multiple languages	
Freeware limitations:	
Known limitations:	

10 Steps to Multi-Language Delphi Projects
1.	Make a complete backup of your delphi project
CodeTrans changes your source files while scanning them. So be sure to have a backup copy of your files (better be safe than sorry!).
CodeTrans gives you the possibility to back up all affected files in your project to a zip archive automatically when creating a new Translation Project (see step 2). The archive files is named as the Translation Project and stored in the CodeTrans program directory.
2.	Create a new Translation Project by clicking the + in the db-navigator.
Enter a name for your Translation Project (Delphi project name recommended) and be sure to specify the correct path for your Delphi project. CodeTrans will reject directories that do not exist. 
The recursive checkbox indicates whether CodeTrans scans the subdirectories of your project dierectory or not.
If recursive is checked, CodeTrans scans all subdirectories but those specified in the Excluded listbox.
3.	Add a new language for your project.
Click the Add button beside the language listbox to add a new language to your project. CodeTrans creates a set of database tables for each added language. 
4.	Scan the source code of your project (menu "scan | code")
Click the "scan" menu item and then "code" to scan all .pas files for strings. 
You are asked to specify some parameters for the scan process:
•	Extenstions specifies the files that are scanned.
•	If Ignore Interface is checked, the interface sections of the source files ase ignored.
•	Min. Length specifies the minimum length of a string to be scanned.
•	Line must contain contains a set of characters of which at least one must be contained by the string to be scanned.
•	Number of context lines specifies the number of source code lines that are stored in the database together with the string. These lines are shown in the Translation Editor window during the translation process.
•	String must not start with contains characters that prevent a string from beeing translated when is begins whith one of these characters.
•	Line must not contain resp. Word must not contain allows you to specify substrings that must not be contained by lines or words to be scanned.
•	Delete Tables deletes all database tables related to that project and language. All translations will be lost.

When pressing the scan button every string found matching the above conditions is replaced by a string constant in the source file and inserted into a database table. After that the Translation Editor opens and shows you a grid with all found strings.
5.	Translate the strings extracted from your source code
The Translation Editor window lets you translate all found strings. 
•	Use the Forms and Code buttons to switch between strings found in the code and such found in the forms
•	The checkboxes blind out the strings that have the corresponding fields checked.
•	The Translate Font button lets you translate the name of the font you use in your forms (if a font name has been scanned!). You will need this when translating to languages whith different scripts (i.e. greek or russian).
•	The Display Font button lets you select a font to display the translated strings. You will need this when translating to languages whith different scripts (i.e. greek or russian).
•	Use the Search button to search your string table for specific strings.
6.	Scan the forms of your project (menu "scan | forms")
Click the "scan" menu item and then "forms" to scan all .dfm files for strings. 
You are asked to specify some parameters for the scan process:
•	Extenstions specifies the files that are scanned.
•	Line must not contain lets you specify substrings that prevent a line of beeing scanned (i.e. enter "font" to prevent font names to be scanned and then translated). 
•	Delete Tables deletes all database tables related to that project and language. All translations will be lost.

When pressing the scan button every string found matching the above conditions is inserted into a database table. After that the Translation Editor opens and shows you a grid with all found strings.
7.	Translate the strings extracted from your forms
The Translation Editor window lets you translate all found strings. 
See step 5 for further information.
8.	Write changes both to the source code and to the forms (menu "Write 	changes | code" and "Write changes | forms")
9.	Recompile your project.
Start Delphi and open your project. Remove the full stop in {.$define TranslatedForm} in c_trans.inc and recompile your project. Your exe file now shows the translated string. If your project doesn't compile, refer to the known limitations section at the end of this document.
10.	Switching between multiple languages
Just select the wanted language in the languages listbox and write the changes to both source code and forms (see step 8 and 9). To restore your project to the original language just put the full stop into {.$define TranslatedForm} in c_trans.inc.

If you make any changes to your source code or forms after having translated your project, rescan source code and forms (steps 4 to 9). Changed strings have the checkbox "changed" checked in the string grid of the Tranlation Editor window, new strings simply aren't translated. Show all those by checking the "Not translated only" and/or "Changed only" checkboxes.

Freeware limitations
The freeware version is restricted to 15 delphi forms and 30 source files. If your project exceeds this limitations you have to get the unrestricted full version of CodeTrans for only US$ 49 from http://www.digibuy.com/cgi-bin/dept.html?501.

Known limitations

•	CodeTrans does not translate the Windows Common Dialogs (FileOpenDialog, FontDialog, etc.). The language of the Common Dialogs will be the one of the operating system the translated program works on.
•	System strings as used in MessageDlg (mbOK, mtInformation, etc.) are not translated by default. Those messages will be shown in the language of the Delphi version you work on. http://www.borland.com/devsupport/delphi/download_files/d3consts.zip contains four pascal source files with the string constants for those strings. If you want to have those strings translated you must copy these pascal files to your project directory and translate the strings.
•	CodeTrans can not distinguish between String and Pchar in function arguments and the StringIDs CodeTrans inserts to your code are not accepted as PChar. As a result your code will not be compilable after translation when you use functions that need PChars as arguments. In that case you have to insert a type cast to PChar around the string constants CodeTrans inserts (i.e. change "SetWindowText(PrintDialog1.Handle, ''+s_88654+'');" to "SetWindowText(PrintDialog1.Handle, PChar(''+s_88654+''));"
•	Window title fonts and menu fonts are system specific in Windows. Therefor when you change the font of your translated project neither the window title font nor the menu font will be affected. Those two fonts are specified in the system settings of the operating systems.
•	File names for Paradox tables have restricted lengths. If you encounter an error message that says "File name too long for a Paradox version 5.0 table" you have to move all files associated with CodeTrans to a location with a shorter path name.